<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>如果选择器复杂，对比权重个数</title>
    <style>
        div.box1 #box1 {
            color: red;
        }

        .box2 div #box2 {
            color: blue;
        }

        div.box2 #box3 {
            color: gold;
        }
    </style>
</head>

<body>
    <div id="box1" class="box1">
        <div id="box2" class="box2">
            <div id="box3" class="box3">
                <p>中国</p>
            </div>
        </div>
    </div>
</body>

</html>